/*
    随机生成范围内的奖金录入数组,并将奖项抽出,且没有重复
 */

package com.itheima.idea;

import java.util.Random;

public class Demo6Metchod {
    public static void main(String[] args) {
        int[] arr = new int[6];
        chou(arr);

    }

    public static void chou(int arr[]) {
        int count = 0;
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
             arr[i] = r.nextInt(1000000);
        }
        while (true) {
            if (count == arr.length) {
                break;
            } else {

                int index = r.nextInt(arr.length);
                if (arr[index] != 0) {
                    System.out.println("抽到的奖金为:" + arr[index]);
                    arr[index] = 0;
                    count++;

                }
            }


        }

    }

}







